﻿@layout MainLayout
@page "/"
@page "/index"
<h3>Indexsdfaasdfasdf</h3>
<Button Text="测试" OnClick=asdf></Button>
<ErrorLogs>

</ErrorLogs>

@code
{
    [Inject]
    ModalService modalService { set; get; }

    private async Task asdf()
    {
        ModalOption option = new ModalOption();
        option.Title = DateTime.Now.ToString();
       
        option.BodyTemplate = builder =>
            {
                var index = 0;
                Dictionary<string, object> parameters = new Dictionary<string, object>();
                parameters.Add(nameof(TestModal.Title), DateTime.Now.ToString());
                var component = BootstrapDynamicComponent.CreateComponent<TestModal>(parameters);
                builder.AddContent(index, component.Render());
            };

        modalService.Show(option);
    }
}

